package com.ghostbusters.fingertrack.gui;

import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JPanel;

import dxn.blue.animation.renderers.dxaBasicRenderer;
import dxn.blue.game.AnimatedGameUnit;


public class LugiaPanel extends JPanel implements MouseListener{

	dxaBasicRenderer renderer;
	AnimatedGameUnit unit;
	
	public LugiaPanel(){
		this.setOpaque(true);
		renderer = new dxaBasicRenderer("bob");
        renderer.frameRate(15);
        renderer.setOpaque(false);
       // rendering.setOpaque(false);

                unit = new AnimatedGameUnit();
                unit.name("Lugia");
                unit.easyInitialize("res\\testSprites\\Lugia",".png");
                unit.setMoveSpeed(40);

                renderer.add(unit);
                unit.setPosition(0, 0);
                
                /*
                for(int x = -400; x<800; x+=80){
                	for(int y = -100; y< 500; y+=60){
                		System.out.println(x+" "+y);
                		AnimatedGameUnit lugia = new AnimatedGameUnit();
                		lugia.name("Lugia");
                        lugia.easyInitialize("res\\testSprites\\Lugia",".png");
                        lugia.setMoveSpeed(40);
                        lugia.setPosition(x, y);
                        
                        renderer.add(lugia);
                        
                		
                	}
                	
                	
                }
                */
        renderer.runT();
        this.add(renderer);
        this.addMouseListener(this);
	}
	
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.fillOval(25, 25, 30, 30);
	}
	
	
    public void move(int x,int y)
    {
//        unit.setDestination(x,y);
    }

    public void mousePressed(MouseEvent e) {
      move( e.getX(), e.getY());
//      move( e.getX()-(int)renderer.getX()-80, e.getY()-(int)renderer.getY()-100);
   }

   public void mouseReleased(MouseEvent e) {

   }

   public void mouseEntered(MouseEvent e) {

   }

   public void mouseExited(MouseEvent e) {

   }

   public void mouseClicked(MouseEvent e) {

   }
	
}
